package com.nuumoblie.bluetoothtools.ble.db.entity;

import androidx.room.ColumnInfo;
import androidx.room.Entity;
import androidx.room.ForeignKey;
import androidx.room.Index;
import androidx.room.PrimaryKey;
import androidx.room.TypeConverter;

import java.util.UUID;

@Entity(indices = {@Index("service_id")},foreignKeys = @ForeignKey(entity = BleServiceEntity.class,
        parentColumns = "_id",
        childColumns = "service_id"),tableName = "ble_characteristic")
public class BleCharacteristicEntity {

    @PrimaryKey(autoGenerate = true)
    private int _id;

    @ColumnInfo(name = "service_id")
    private int mServiceId;

    @ColumnInfo(name = "uuid")
    private UUID mUuid;

    @ColumnInfo(name = "value")
    private String mValue;

    @ColumnInfo(name = "permission")
    private int mPermission;

    @ColumnInfo(name = "write_type")
    private int mWriteType;

    public BleCharacteristicEntity(int mServiceId, UUID mUuid, String mValue, int mPermission, int mWriteType) {
        this.mServiceId = mServiceId;
        this.mUuid = mUuid;
        this.mValue = mValue;
        this.mPermission = mPermission;
        this.mWriteType = mWriteType;
    }

    public int get_id() {
        return _id;
    }

    public void set_id(int _id) {
        this._id = _id;
    }

    public int getServiceId() {
        return mServiceId;
    }

    public void setServiceId(int mServiceId) {
        this.mServiceId = mServiceId;
    }

    public UUID getUuid() {
        return mUuid;
    }

    public void setUuid(UUID mUuid) {
        this.mUuid = mUuid;
    }

    public String getValue() {
        return mValue;
    }

    public void setValue(String mValue) {
        this.mValue = mValue;
    }

    public int getPermission() {
        return mPermission;
    }

    public void setPermission(int mPermission) {
        this.mPermission = mPermission;
    }

    public int getWriteType() {
        return mWriteType;
    }

    public void setWriteType(int mWriteType) {
        this.mWriteType = mWriteType;
    }
}
